package com.sxhalo.fsms.exception;


public class CustomException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4221454800255677674L;

	private String code;
	
	private String msg;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	/**
     * @param code 异常码
     * @param msg 异常信息
     */
    public CustomException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
    
    /**
     * @param code 异常码
     * @param msg 异常信息
     * @param cause 异常对象
     */
    public CustomException(String code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }
	
    /**
     * @param error 错误对象
     */
    public CustomException(BaseEnumError error) {
        super(error.getMsg());
        this.code = error.getCode();
        this.msg = error.getMsg();
    }

    /**
     * @param error 错误对象
     * @param cause 异常对象
     */
    public CustomException(BaseEnumError error, Throwable cause) {
        super(error.getMsg(), cause);
        this.code = error.getCode();
        this.msg = error.getMsg();
    }
    
}
